<!DOCTYPE html>
<html>
<head>
<TITLE>蓝图图示剪切画</TITLE>
<META NAME="Keywords" CONTENT="蓝图图示-思维图示-云图示-蓝图剪切画">
<META NAME="Description" CONTENT="蓝图图示按各类情景收集剪切画供绘制图示作品">
<meta content="always" name="referrer">
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" href="pure-min.css"/>
<style>
#content, body, html {
    background-color: #f1f2f3;
}

.grid-sizer,
.grid-item {
	position:absolute; left:0px;
	margin-bottom: 10px;
	float: left;
	/*width: 160px;*/
	width: 15%;
	background-color: #fff;
    border-left: 1px solid #dedfe0;
    border-right: 1px solid #dedfe0;
    border-bottom: 3px solid #E3E4E5;
    margin-right: 5px;
    margin-top: 5px;
    border:1px solid rgba(0,0,0,.08);
}

.container-fluid {
	position: relative; 
	padding: 5px;
	/*background: #DDD;*/
	background-color:f1f2f3;
}
/* clear fix */
.container-fluid:after {
  content: '';
  display: block;
  clear: both;
}
.grid-item img {
	display: block;
	max-width: 100%;
	max-height: 200px;
}

a.dt-woo-cat{
	position: absolute;
    bottom: 10px;
    right: 10px;
    /* width: 56px; */
    height: 25px;
    line-height: 25px;
    vertical-align: middle;
    background-color: #fb3;
    font-size: 12px;
    color: #fff;
    text-decoration: none;
    text-align: center;
    border-radius: 2px;
}
.dt-woo-desc{
	padding: 1px;
}
.dt-woo-title {
    padding: 12px;
}
.dt-woo-title a {
    font-size: 13px;
    color: #444;
    font-weight: 700;
}
.dt-woo-attr {
    font-size: 12px;
    color: #888;
    padding: 0 12px 0px;
}
#page_nav {clear: both; text-align: center; }
#page_loading {display: none; background: #111111; opacity: 0.7; height: 60px; width: 220px;  padding: 10px; position: absolute; bottom: -50px; left: 330px; }
</style>

<script src="constant.js"></script>
<script src="jquery-1.12.0.min.js"></script>
<script src="masonry.pkgd.min.js"></script>
<script src="imagesloaded.pkgd.min.js"></script>
	<script>
		var _hmt = _hmt || [];
		(function() {
		  var hm = document.createElement("script");
		  hm.src = "//hm.baidu.com/hm.js?6d221bb715045782d5cc16288e1a2c58";
		  var s = document.getElementsByTagName("script")[0]; 
		  s.parentNode.insertBefore(hm, s);
		})();
	</script>
	<script>
	(function(){
		var bp = document.createElement('script');
		var curProtocol = window.location.protocol.split(':')[0];
		if (curProtocol === 'https') {
			bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';        
		}
		else {
			bp.src = 'http://push.zhanzhang.baidu.com/push.js';
		}
		var s = document.getElementsByTagName("script")[0];
		s.parentNode.insertBefore(bp, s);
	})();
	</script>
<script>
	

	var readedpage = 1;//当前滚动到的页数  
	function share_icons_more(){
		loading_share_icons(++readedpage);
	}
	function use(url){
		parent.draw_img(url);
	}
	function addFavorite(imgId){
		
			$.ajax({
				type : "POST",
				url : "http://" + host + "/draw/addfavorite.action",
				data : "imgId="+imgId,//
				dataType : "json",
				success : function(data) {
					if(data.code!=undefined&&data.code!="1"){
						$('#loginPageHref', parent.document).trigger("click");
						
					}else{
					alert(data.desc);
					}
				}
			,
			error : function() {
				alert("失败");
			}
		});
	}

	
	function loading_share_icons(pageno){
		
		//masonry参考：http://stackoverflow.com/questions/8722197/jquery-masonry-and-ajax-append-items
		var one_row="";
		$.ajax({
			type : "POST",
			url : "http://" + host + "/draw/shareicon.action",
			data : "pageno="+pageno,//
			dataType : "json",
			success : function(data) {
				// var obj=eval('(' + data + ')');
				

				$.each(
					data,
					function(i, item) {

						one_row = one_row+ "<div class=\"grid-item\"><img  hint=\"按住鼠标拖动到面板上\" class=\"draw2d_droppable\"  src=\"/icon/"
											+ item.imgFileName
											+ "\"/>";
											
					one_row = one_row+ "<div class=\"dt-woo-desc\">";
					one_row = one_row+ "<p class=\"dt-woo-title\">";
					one_row = one_row+ "<a target=\"_blank\" href=\"\">"+item.descriptin+"</a>";
					one_row = one_row+ "</p>";
					one_row = one_row+ "<p class=\"dt-woo-attr\">";
					one_row = one_row+ "0人";
					one_row = one_row+ "</p>";
					one_row = one_row+ "<a target=\"_blank\" href=\"javascript:void(0);\" onclick=\"addFavorite('"+item.id+"')\" class=\"dt-woo-cat\">";
					one_row = one_row+ "收藏";
					one_row = one_row+ "</a>";
					one_row = one_row+ "</div>";
					one_row = one_row+ "</div>";		
					}
				);
				if (one_row.length > 0) {
					$newElems = $(one_row).css({ opacity: 0 });
                 	$newElems.imagesLoaded(function(){
	                	 //reloadItems
	                     $container.append($newElems)
	                     .masonry( 'appended', $newElems) 
	                     .masonry();
	                     // 渐显新的内容  
	                     $newElems.animate({ opacity: 1 });
	                     // 隐藏正在加载模块
	                     $("#page_loading").hide("slow");                            
                 	});
				}
			},
			error : function() {
				alert("失败");
			}
		});
	}
	var $container ;
	$(function() {
		$container = $('#iconsfluidDiv');
		$container.imagesLoaded(function() {
			$container.masonry({
				itemSelector : '.grid-item'
			});
		});
		loading_share_icons(1);
		
	});
	

</script>
</head>
<body>

	<script>window._bd_share_config={"common":{"bdSnsKey":{},"bdText":"","bdMini":"2","bdMiniList":false,"bdPic":"","bdStyle":"0","bdSize":"16"},"image":{"viewList":["tsina"],"viewText":"分享到：","viewSize":"16"}};with(document)0[(getElementsByTagName('head')[0]||body).appendChild(createElement('script')).src='http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion='+~(-new Date()/36e5)];</script>
	<div class="container-fluid" id="iconsfluidDiv">

		
	</div>
	<div id="page_nav">
	    <input type="button" id="next_link" onclick="share_icons_more();" value="下一页"/>
	</div>
	<div id="page_loading">
    <span>加载中……</span>
</div>
</body>

</html>